package cn.xiaopengstack.domain.pay.event;

import cn.xiaopengstack.domain.order.model.valobj.PayOrderStatusEnumVO;
import cn.xiaopengstack.types.event.BaseEvent;
import cn.xiaopengstack.types.event.TopicConstant;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * @author jiangyangang
 */
public class PayResultHandelEvent extends BaseEvent<PayResultHandelEvent.PayResultMessage> {

    public PayResultHandelEvent(PayResultMessage data, String key) {
        super(data, key);
    }

    @Override
    public String topic() {
        return TopicConstant.PAY_RESULT_HANDEL_TOPIC;
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @Builder
    public static class PayResultMessage implements Serializable {

        /**
         * 订单号
         */
        private String orderId;

        /**
         * 用户ID
         */
        private String userId;

        /**
         * 订单状态
         */
        private PayOrderStatusEnumVO statusEnumVO;

        /**
         * 支付时间
         */
        private Date payTime;

        /**
         * 支付流水
         */
        private String payOrderId;
    }
}
